package core
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;

	public class EventManager extends EventDispatcher
	{
		public static const EVENT_RES_COMPLETE : String = "EVENT_RES_COMPLETE";
		public static const EVENT_PUB_COMPLETE : String = "EVENT_PUB_COMPLETE";
		private static var instance : EventManager;

		public function EventManager(target : IEventDispatcher = null)
		{
			super(target);
		}

		public static function getInstance() : EventManager
		{
			if(instance == null)
				instance = new EventManager();
			return instance;
		}

		public function dispatchListener(evt : String) : void
		{
			this.dispatchEvent(new Event(evt));
		}

		public function addListener(type : String , listener : Function , useCapture : Boolean = false , priority : int = 0 , useWeakReference : Boolean = false) : void
		{
			this.addEventListener(type , listener , useCapture , priority , useWeakReference);
		}
	}
}